package com.quasar.hpatient.bean.home;

import android.text.TextUtils;

import com.quasar.hpatient.R;
import com.quasar.hpatient.bean.home_medicine.MedicineTodayBean;

import lib.quasar.context.BaseApp;
import lib.quasar.recycler.model.MultModel;

/**
 * description: 首页信息
 * created by kalu on 2018/3/28 16:27
 */
public class HomeBean implements MultModel {

    /*************************************************************/

    private int homeType = 0;

    @Override
    public int getMultType() {
        return homeType;
    }

    public void setMultType(int homeType) {
        this.homeType = homeType;
    }

    public MedicineTodayBean.ItemBean getMedicine() {
        return medicine;
    }

    public void setMedicine(MedicineTodayBean.ItemBean medicine) {
        this.medicine = medicine;
    }

    /*************************************************************/

    private MedicineTodayBean.ItemBean medicine = null;

    private int medicineStatus = 0; //0未服 1已服 2异常
    private int medicineOrder = 0;
    private int medicineNumber = 0;
    private String medicineName = "";
    private String medicineUnit = "";
    private String medicineTime = "";
    private String medicineTimeReal = "";
    private String medicineDate = "";

    public int getMedicineStatus() {
        return medicineStatus;
    }

    public void setMedicineStatus(int medicineStatus) {
        this.medicineStatus = medicineStatus;
    }

    public int getMedicineOrder() {
        return medicineOrder;
    }

    public void setMedicineOrder(int medicineOrder) {
        this.medicineOrder = medicineOrder;
    }

    public int getMedicineNumber() {
        return medicineNumber;
    }

    public String getMedicineNumbers() {
        return String.valueOf(medicineNumber);
    }

    public void setMedicineNumber(int medicineNumber) {
        this.medicineNumber = medicineNumber;
    }

    public String getMedicineName() {
        return medicineName;
    }

    public void setMedicineName(String medicineName) {
        this.medicineName = medicineName;
    }

    public String getMedicineUnit() {
        return medicineUnit;
    }

    public void setMedicineUnit(String medicineUnit) {
        this.medicineUnit = medicineUnit;
    }

    public String getMedicineDate() {
        return medicineDate;
    }

    public void setMedicineDate(String medicineDate) {
        this.medicineDate = medicineDate;
    }

    public String getMedicineTime() {
        try {
            return medicineTime.substring(0, 5);
        } catch (Exception e) {
            return "00:00";
        }
    }

    public String getMedicineTimes() {
        return medicineTime;
    }

    public void setMedicineTime(String medicineTime) {
        this.medicineTime = medicineTime;
    }

    public String getMedicineTimeReal() {
        return medicineTimeReal;
    }

    public void setMedicineTimeReal(String medicineTimeReal) {
        this.medicineTimeReal = medicineTimeReal;
    }

    public String getMedicineInfo() {

        if (medicineStatus == 0) {
            return "未服";
        } else {
            try {
                return medicineTimeReal.substring(11, 16);
            } catch (Exception e) {
                return "00:00";
            }
        }
    }

//    public boolean isMedicineNull() {
//        return TextUtils.isEmpty(medicineName);
//    }

    public boolean isMedicineNull() {
        return null == getMedicine();
    }

    public boolean isMedicine() {
        return homeType == MultModel.TYPE_2;
    }

    public boolean isMedicineOral() {
        return medicineStatus != 0;
    }

    public int getMedicineColors() {

        if (medicineStatus != 1) {
            return R.color.color_bg_peach;
        } else {
            return R.color.color_black;
        }
    }

    /*************************************************************/

    private String messageIcon = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531540938527&di=ab725c5f2e1ea22bab73022305f872b9&imgtype=0&src=http%3A%2F%2Fimg4.duitang.com%2Fuploads%2Fitem%2F201603%2F04%2F20160304145237_amskB.jpeg";
    private String messageName = "";
    private String messageText = "";
    private String messageTime = "";
    private int messageNumber = 0;
    private long messageId = 0L;

    public String getMessageIcon() {
        return messageIcon;
    }

    public void setMessageIcon(String messageIcon) {
        this.messageIcon = messageIcon;
    }

    public String getMessageName() {
        return messageName;
    }

    public void setMessageName(String messageName) {
        this.messageName = messageName;
    }

    public String getMessageText() {
        return messageText;
    }

    public void setMessageText(String messageText) {
        this.messageText = messageText;
    }

    public String getMessageTime() {
        return messageTime;
    }

    public void setMessageTime(String messageTime) {
        this.messageTime = messageTime;
    }

    public int getMessageNumber() {
        return messageNumber;
    }

    public void setMessageNumber(int messageNumber) {
        this.messageNumber = messageNumber;
    }

    public long getMessageId() {
        return messageId;
    }

    public void setMessageId(long messageId) {
        this.messageId = messageId;
    }

    /*************************************************************/
}
